﻿@{
    ViewData["Title"] = "Home Page";
}

<div class="text-center">
    <h1 class="display-4">Welcome</h1>
    <p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
</div>

<iframe src="http://localhost:3000/d-solo/8ELZ1an7z/app-metrics-web-monitoring-influxdb-myseconddatabase?orgId=1&refresh=5s&from=1629788247270&to=1629788547270&panelId=8" width="450" height="200" frameborder="0"></iframe>

<iframe src="http://localhost:3000/d/8ELZ1an7z/app-metrics-web-monitoring-influxdb-myseconddatabase?orgId=1&refresh=5s" 
        style="width:100%;height:500px" frameborder="0" id="output-frame-id">

</iframe>

<script type="text/javascript">
    //var xhr = new XMLHttpRequest();

    //var token = "eyJrIjoiNEt6VEVJcTlTa2lhalg1RmZLZTR1MTF3dGoxTnlCbXAiLCJuIjoi5oiR55qE56ys5LiA5LiqQVBJ6ZSuIiwiaWQiOjF9";

    //xhr.open('GET', 'http://localhost:3000/d/8ELZ1an7z/app-metrics-web-monitoring-influxdb-myseconddatabase?orgId=1&refresh=5s');
    //xhr.onreadystatechange = handler;
    //xhr.responseType = 'blob';
    //xhr.setRequestHeader('Authorization', 'Bearer ' + token);
    //xhr.send();

    //function handler() {
    //    if (this.readyState === this.DONE) {
    //        if (this.status === 200) {
    //            // this.response is a Blob, because we set responseType above
    //            var data_url = URL.createObjectURL(this.response);
    //            document.querySelector('#output-frame-id').src = data_url;
    //        } else {
    //            console.error('no pdf :(');
    //        }
    //    }
    //}
</script>
